﻿namespace WPFDBBrowser.MessageBus
{
    using System;

    public interface IEndPoint
    {
        IMessageBus Bus { get; set; }
        string Address { get; set; }

        IEndPoint Start();
        IEndPoint Stop();
        IEndPoint Publish<TMessage>(TMessage message);
        IEndPoint Subscribe<TMessage>(Guid subscriptionId, Action<TMessage> notify);
        IEndPoint Subscribe<TMessage>(Guid subscriptionId, Action<TMessage> notify, Predicate<TMessage> filter);
        IEndPoint Send<TMessage>(TMessage message, string address);
        IEndPoint Send<TRequest, TResponse>(TRequest request, string address, Action<TResponse> reply);
        IEndPoint UnSubscribe(Guid subscriptionId);
    }
}
